﻿using System;
using MyLibrary;

namespace MyConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var factorizer = new PrimeFactorizer();
            Console.WriteLine("请输入一个正整数（最大取值为1000）：");
            if (int.TryParse(Console.ReadLine(), out int number))
            {
                try
                {
                    string result = factorizer.PrimeFactors(number);
                    Console.WriteLine($"{number} 的质因数是: {result}");
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            else
            {
                Console.WriteLine("输入无效，请输入一个正整数。");
            }
        }
    }
}